<% const serverCurCode = ob.walletCur.code %>
<div class="flex gutterHSm clrT <% if (ob.status === 'CONFIRMED') print('confirmedTransaction') %>">
  <%
    let statusIcon = 'ion-ios-checkmark-empty';
    let statusIconClasses = 'clrTEmph1';

    if (ob.status === 'DEAD') {
      statusIcon = 'ion-ios-close-empty';
      statusIconClasses = 'tx1 clrTErr';
    } else if (ob.status === 'STUCK') {
      statusIcon = 'ion-alert-circled';
      statusIconClasses = 'tx3 clrTEmph1';
    } else if (ob.status === 'PENDING' || ob.status === 'UNCONFIRMED') {
      statusIcon = 'ion-android-time';
      statusIconClasses = 'tx3';
    }
  %>
  <div class="statusIconCol <%= statusIconClasses %>"><span class="<%= statusIcon %>"></span></div>
  <div class="flexExpand tx5">
    <%
      let priceFrag = ob.currencyMod.pairedCurrency(
        Math.abs(ob.value),
        serverCurCode,
        ob.userCurrency
      );

      priceFrag = ob.value < 0 ? `-${priceFrag}` : `+${priceFrag}`;

      let infoLine = '';

      if (ob.value > 0) {
        infoLine = ob.polyT('wallet.transactions.transaction.incomingText', {
          currencyPairing: `<span class="txB flexNoShrink margRTxt clrTEm">${priceFrag}</span>`,
        });
      } else {
        const currencyPairing = `<span class="txB flexNoShrink margRTxt clrTEm">${priceFrag}</span>`;

        if (ob.address) {
          infoLine = ob.polyT('wallet.transactions.transaction.outgoingText', {
            currencyPairing,
            address: `<span class="toAddress margLTxt noOverflow clrTEmph1">${ob.address}</span>`,
          });
        } else {
          infoLine = currencyPairing;
        }
      }
    %>
    <div class="rowTn flex"><%= infoLine %></div>
    <%
      let timeAgoAndConfirmCount = ob.polyT('wallet.transactions.transaction.timeAgoAndConfirmCount', {
        timeAgo: ob.timeAgo,
        confirmationsCount: ob.confirmations,
        smart_count: ob.confirmations,
      });
    %>
    <div>
      <div class="flexInline gutterH margR clrT2 tx6 floL">
        <div class="flexNoShrink"><%= timeAgoAndConfirmCount %></div>
        <div class="flexNoShrink" style="max-width: 80px">
          <div class="noOverflow"><a class="clrT2 txU js-txidLink"><%= ob.txid %></a></div>
        </div>
      </div>
      <%
        const memo = ob.translatedMemo || ob.memo.length > 300 ? `${ob.memo.slice(0, 300)}…` : ob.memo;
      %>
      <div class="clrT2 tx6" style="vertical-align: text-top;"><%= memo %></div>
    </div>
  </div>
  <div class="col">
    <div class="flexHRight">
      <div class="btnStrip">
        <a class="btn clrP clrBr clrSh2" href="<%= ob.walletCur.getBlockChainTxUrl(ob.txid, ob.isTestnet) %>"><%= ob.polyT('wallet.transactions.transaction.viewDetailsBtn') %></a>
        <% if (ob.allowFeeBump) { %>
          <%= ob.processingButton({
            className: `btn clrP clrBr clrSh2 js-retryPmt ${ob.retryConfirmOn ? 'disabled' : ''} ${ob.retryInProgress ? 'processing' : ''}`,
            btnText: ob.polyT('wallet.transactions.transaction.retryTransactionBtn')
          }) %>
        <% } %>
      </div>
    </div>
  </div>
</div>
<div class="js-retryPmtConfirmed confirmBox retryConfirm arrowBoxTop clrBr clrP clrT clrSh1 <% if (!ob.retryConfirmOn) print('hide') %>">
  <% let insufficientFunds = false; %>
  <div class="tx3 txB rowSm"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.title') %></div>
  <% if (ob.fetchingEstimatedFee) { %>
    <%= ob.spinner({ className: 'txCtr spinnerMd' }) %>
  <% } else if (ob.fetchFeeFailed) { %>
    <p class="clrT2 bodyText"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.fetchError', { err: ob.fetchFeeError || '' }) %></p>
    <a class="js-retryFeeFetch clrTEm"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.btnRetry') %></a>
  <% } else if (typeof ob.estimatedFee === 'number') {
    let estimatedFeeCombo = ob.currencyMod.pairedCurrency(
      ob.estimatedFee,
      serverCurCode,
      ob.userCurrency
    );

    insufficientFunds = ob.walletBalance && ob.walletBalance.confirmed < ob.estimatedFee;
  %>
    <% if (!insufficientFunds) { %>
      <p class="clrT2 bodyText"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.body', {
        currencyPairing: estimatedFeeCombo,
        asterisk: '<span>*</span>',
      }) %></p>
    <% } else { %>
      <p class="clrT2 bodyText"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.insufficientFundsBody', {
        currencyPairing: estimatedFeeCombo,
        asterisk: '<span>*</span>',
      }) %></p>
    <% } %>
    <p class="clrT2 tx6"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.subText', {
      asterisk: '<span>*</span>',
    }) %></p>
  <% } %>

  <hr class="clrBr row" />
  <div class="flexHRight flexVCent gutterHLg buttonBar">
    <a class="js-retryConfirmCancel"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.btnCancel') %></a>
    <a class="btn clrBAttGrad clrBrDec1 clrTOnEmph js-btnConfirmRetrySend <% if (ob.fetchingEstimatedFee || insufficientFunds) print('disabled') %>"><%= ob.polyT('wallet.transactions.transaction.retryPaymentConfirmBox.btnConfirmSend') %></a>
  </div>
</div>
<% if (ob.copiedIndicatorOn) { %>
<div class="copiedIndicator clrT tx6">Copied to clipboard</div>
<% } %>
